<html>
<head><meta charset="utf-8"><title>async fn in rustdoc · wg-async-foundations · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/index.html">wg-async-foundations</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20fn.20in.20rustdoc.html">async fn in rustdoc</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="221992096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20fn%20in%20rustdoc/near/221992096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20fn.20in.20rustdoc.html#221992096">(Jan 07 2021 at 19:54)</a>:</h4>
<p>I just noticed there are exactly two rustdoc issues open about async await. <a href="https://github.com/rust-lang/rust/issues/65677">https://github.com/rust-lang/rust/issues/65677</a> I have some idea how to do - it will be hard but I think it's possible. <a href="https://github.com/rust-lang/rust/issues/69781">https://github.com/rust-lang/rust/issues/69781</a> I don't even know what the right behavior is. It would be nice to get some feedback from the wg about that.</p>



<a name="221992247"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20fn%20in%20rustdoc/near/221992247" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Didrik Nordstrom <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20fn.20in.20rustdoc.html#221992247">(Jan 07 2021 at 19:55)</a>:</h4>
<p>These are interesting</p>



<a name="221992363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20fn%20in%20rustdoc/near/221992363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Didrik Nordstrom <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20fn.20in.20rustdoc.html#221992363">(Jan 07 2021 at 19:56)</a>:</h4>
<blockquote>
<p>In the documentation it is hard to distinguish async functions from normal functions.</p>
</blockquote>
<p>nod</p>



<a name="221994692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20fn%20in%20rustdoc/near/221994692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20fn.20in.20rustdoc.html#221994692">(Jan 07 2021 at 20:15)</a>:</h4>
<p>made a new topic</p>



<a name="221994953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20fn%20in%20rustdoc/near/221994953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20fn.20in.20rustdoc.html#221994953">(Jan 07 2021 at 20:17)</a>:</h4>
<p>on <a href="https://github.com/rust-lang/rust/issues/69781">#69781</a> I've weighed in a few times. I think an async "badge" or similar would be helpful. I'm also open to rewriting all the signatures to return <code>impl Future</code>, whether as an opt-in or by default, but would probably want to experiment with it some before turning it on everywhere</p>



<a name="221995121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20fn%20in%20rustdoc/near/221995121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20fn.20in.20rustdoc.html#221995121">(Jan 07 2021 at 20:19)</a>:</h4>
<p>For <a href="https://github.com/rust-lang/rust/issues/65677">#65677</a> I agree that a solution that works for all <code>impl Trait</code> would be nice. I'm wondering if adding "imaginary bounds" in a gray color would work</p>



<a name="221995201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20fn%20in%20rustdoc/near/221995201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20fn.20in.20rustdoc.html#221995201">(Jan 07 2021 at 20:19)</a>:</h4>
<p>e.g. <code>fn foo() -&gt; impl Future&lt;Output = i32&gt;</code> <code>+ Send + Sync</code> where the second part is grayed out</p>



<a name="221996826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20fn%20in%20rustdoc/near/221996826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20fn.20in.20rustdoc.html#221996826">(Jan 07 2021 at 20:32)</a>:</h4>
<p>Ooh I like that</p>



<a name="221996866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20fn%20in%20rustdoc/near/221996866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20fn.20in.20rustdoc.html#221996866">(Jan 07 2021 at 20:32)</a>:</h4>
<p>And it says on hover that this isn't guaranteed by the implementation or something</p>



<a name="221996942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20fn%20in%20rustdoc/near/221996942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20fn.20in.20rustdoc.html#221996942">(Jan 07 2021 at 20:33)</a>:</h4>
<p><span class="user-mention" data-user-id="218683">@Alice Ryhl</span> has said a few times that this is a major pain point for tokio, that Send + Sync are easy to break by accident because they're not written in the code</p>



<a name="221997106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20fn%20in%20rustdoc/near/221997106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20fn.20in.20rustdoc.html#221997106">(Jan 07 2021 at 20:34)</a>:</h4>
<p>Anyway I think it makes sense to implement both the toggle and "rewrite everything to impl Future" behind an unstable flag so people can try out both on nightly</p>



<a name="221997128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20fn%20in%20rustdoc/near/221997128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20fn.20in.20rustdoc.html#221997128">(Jan 07 2021 at 20:34)</a>:</h4>
<p>I expect the implementation to be pretty easy</p>



<a name="221997222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20fn%20in%20rustdoc/near/221997222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alice Ryhl <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20fn.20in.20rustdoc.html#221997222">(Jan 07 2021 at 20:35)</a>:</h4>
<p>For context, this is what we do about the <code>Send + Sync</code> thing: <a href="https://github.com/tokio-rs/tokio/blob/master/tokio/tests/async_send_sync.rs">https://github.com/tokio-rs/tokio/blob/master/tokio/tests/async_send_sync.rs</a></p>



<a name="222002661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20fn%20in%20rustdoc/near/222002661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Didrik Nordstrom <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20fn.20in.20rustdoc.html#222002661">(Jan 07 2021 at 21:21)</a>:</h4>
<p>Sorry, I missed the topic here. I wrote down my thoughts in an issue comment: <a href="https://github.com/rust-lang/rust/issues/69781#issuecomment-756385482">https://github.com/rust-lang/rust/issues/69781#issuecomment-756385482</a></p>



<a name="222002668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20fn%20in%20rustdoc/near/222002668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Didrik Nordstrom <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20fn.20in.20rustdoc.html#222002668">(Jan 07 2021 at 21:21)</a>:</h4>
<p>TL;DR: I support badge.</p>



<a name="222004050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20fn%20in%20rustdoc/near/222004050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Didrik Nordstrom <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20fn.20in.20rustdoc.html#222004050">(Jan 07 2021 at 21:33)</a>:</h4>
<p>Ack on the Send+Sync issue, but I feel there is more to do in that domain than simply adding docs. It's a well known paper cut.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>